package mya.mes.mdc.plc;

public class TagUtils {

    public static String mdcTag(String prefix, String tagName) {

        if (tagName.length() == 1) {
            return prefix + "000" + tagName;
        }

        if (tagName.length() == 2) {
            return prefix + "00" + tagName;
        }

        if (tagName.length() == 3) {
            return prefix + "0" + tagName;
        }

        if (tagName.length() == 4) {
            return prefix + tagName;
        }

        throw new RuntimeException("过长的TAG:" + tagName);
    }
}
